<template>
	<view class="product-profile">
		<card-com :show-gap="false" :padding="8">
			<view class="content">
				<!-- <view class="isVipPrice" v-if="user&&user.grade=='vip'&&product.is_gold_bean">
					<view class="isVipPriceBg"></view>
					<view class="OpenVip" v-if="user&&user.grade === 'normal'">开通VIP到手价 {{ (product.price_lowest - product.brokerage) | brokerageNum }}</view>
					<view class="" v-else>VIP到手价 {{ (product.price_lowest - product.brokerage) | brokerageNum }}</view>
					<view class="return-money" v-if="user&&user.grade=='normal'&&product.is_return_section">开通VIP后购买立返9.9元会员费</view>
					<view class="return-money" v-if="user&&user.grade=='vip'&&product.is_return_section&&!user.has_returned_product_balance_this_month">立返9.9元会员费</view>
					<view class="return-money" v-if="!user&&product.is_return_section">开通VIP后购买立返9.9元会员费</view>
					<view class="return-money" >立得{{ parseFloat(product.price_lowest) }}个金豆</view>
				</view> -->
								
				<view class="priceAndShare">
					<view class="priceAndShareLeft">
						<view class="normal-price">
							<!-- <view>会员价</view> -->
							<view></view>	
							<view>
								<text>￥</text>
								<text>{{ product.price_lowest }}</text>
							</view>
						</view>
						
					</view>
					
					<!-- <view class="share-btn" @click="shareProduct">
						<image src="/static/images/sharebtn.png" mode=""></image>
						<view>分享</view>
					</view> -->
				</view>
				<view class="return-money-box" v-if="user&&user.grade=='vip'&&product.is_gold_bean">
					<!-- <view class="return-money" >立得{{ parseFloat(product.price_lowest) }}个金豆</view> -->
					<view class="gold-coins">
						<image src="/static/images/gold-coins-text-icon.png" class="gold-coins-text-icon" mode="heightFix"></image>
					  <view class="gold-coins-num">
						  <text class="gold-coins-need">立得<text>{{ parseFloat(product.price_lowest) }}</text> 金豆</text>
					  </view>
					</view>
				</view>
				
				
				<!-- <view class="goods-red-packet">
					<image src="/static/images/redpacket.png" class="redpacket" mode=""></image>
					<view>
						<text>商品红包</text>
						<text>{{ product.brokerage | brokerageNum }}元</text>
					</view>
				</view> -->
				<!-- <image src="/static/images/up-grade-level-tips.png" v-if="user&&user.grade == 'vip'&&user.grade_level==0" class="up-grade-level-tips" mode="" @click="goUpGradeLevel()"></image> -->
				<view class="title">{{ product.title }}</view>
				
				<view class="tips">
					<view >购买后存放酒柜内，每日可获得积分奖励</view>
					<product-selected-no-sku-count-com ></product-selected-no-sku-count-com>
				</view>
				
			</view>
		</card-com>

	</view>
</template>

<script>
	import store from "store"
	import ProductSelectedNoSkuCountCom from "../purchase/ProductSelectedNoSkuCountCom"
	import {
		mapGetters
	} from 'vuex'

	export default {
		name: "ProducProfileCom",
		store,
		components: {
			ProductSelectedNoSkuCountCom
		},
		props: {
			product: {
				type: Object,
				required: true
			},
			isCashBack:{
				default:false
			},
			source:{
				default:'wap'
			}
		},
		computed: {
			...mapGetters(['user'])
		},
		methods: {
			showGuarantee() {
				this.$refs.guaranteepopup.open('bottom')
			},
			showCashbackpopup(){
				this.$refs.cashbackpopup.open('bottom')
			},
			hideCashbackpopup(){
				this.$refs.cashbackpopup.close()
			},
			hideGuarantee() {
				this.$refs.guaranteepopup.close()
			},
			shareProduct() {
				this.$emit('shareProduct')
			},
			goUpGradeLevel(){
				uni.navigateTo({
					url:'/packs/pages/user/member?index=1'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.product-profile {
		.content {
			.head {
				display: flex;
				justify-content: space-between;

				.price {
					display: flex;
					justify-content: flex-start;
					align-items: center;

					.rmb {
						font-style: italic;
						font-size: 32rpx;
						font-weight: 400;
						color: #FF4924;
						margin-top: 18rpx;
					}

					.price-market {
						font-size: 32rpx;
						font-weight: 400;
						color: #555555;
						margin-top: 18rpx;
						margin-right: 10rpx;
					}

					.price-vip {
						font-style: italic;
						font-size: 52rpx;
						font-weight: 800;
						color: #FF4924;
						margin-right: 10rpx;
					}

					.badge {
						width: 80rpx;
						height: 52rpx;
						margin-top: 10rpx;
					}
				}

				.operations {
					.share {
						.button {
							width: 48rpx;
							height: 76rpx;
							border: none;
							background-size: 48rpx 76rpx;
							background-repeat: no-repeat;
							background-image: url("https://littleshop.oss-cn-beijing.aliyuncs.com/images/mini/product/share.png");
						}
					}
				}
			}

			.title {
				font-size: 30rpx;
				font-weight: 700;
				color: #333333;
				margin:20rpx 0 8rpx 0;
				padding: 0 12rpx;
			}

			.tips {
				display: flex;
				justify-content: space-between;
				font-size: 20rpx;
				color: #7e7e7e;
				padding:30rpx 12rpx 12rpx 12rpx;
				line-height:64rpx;
				.arrow {
					width: 24rpx;
					height: 24rpx;
					color: #999999;
				}

				.guarantee-pop {
					position: absolute;
					bottom: 0;
					left: 0;
					z-index: 9999999;
				}
				.guarantee {
					border-top-left-radius: 16rpx;
					border-top-right-radius: 16rpx;
					background: white;
					padding-bottom:100rpx;
					width: 100%;
					position: fixed;
					left:0;
					bottom: 0;
					.head {
						display: flex;
						justify-content: center;
						padding-top: 24rpx;
						font-size: 36rpx;
						font-weight: 400;
						color: #333333;
					}
				
					.items {
						padding: 30rpx;
				
						.item {
							display: flex;
							align-items: center;
							margin-bottom: 30rpx;
				
							.icon {
								width: 44rpx;
								height: 44rpx;
								margin-right: 20rpx;
							}
				
							.desc {
								display: flex;
								flex-direction: column;
								justify-content: flex-start;
				
								.title {
									font-size: 32rpx;
									font-weight: 600;
									color: #333333;
									line-height: 0;
								}
				
								.subtitle {
									width: 500rpx;
									font-size: 24rpx;
									font-weight: 400;
									margin: 10rpx 0 0 15rpx;
									color: #999999;
								}
							}
						}
					}
				
					.know-button {
						width: 650rpx;
						height: 80rpx;
						background: linear-gradient(135deg, #FFDD62 0%, #FFBF0D 100%);
						border-radius: 40rpx;
						border: none;
						font-size: 28rpx;
						font-weight: 400;
						color: #333333;
						line-height: 80rpx;
					}
				}
			}
		}

	}
	.isVipPrice{
		width:100%;
		height: 60rpx;
		border-radius: 12rpx 12rpx 0px 0px;
		position: relative;
		display: flex;
		align-items: center;
		.isVipPriceBg{
			width: 100%;
			height:100%;
			border-radius: 12rpx 12rpx 0px 0px;
			background: linear-gradient(270deg, rgba(255, 73, 36, 0.26) 0%, #FF4924 100%);
			opacity: 0.1;
			position: absolute;
			left:0;
			top:0;
		}
		>view:nth-child(2){
			font-size: 24rpx;
			font-family: PingFangSC-Semibold, PingFang SC;
			font-weight: 600;
			color: #FFFFFF;
			margin-left: 12rpx;
		}
		.return-money{
			height: 42rpx;
			padding: 0 20rpx;
			border-radius:16rpx;
			background: rgb(222,75,72);
			display: flex;
			align-items: center;
			color: #FFFFFF;
			font-size: 24rpx;
			margin-left: 30rpx;
		}
	}
	.return-money-box{
		display: flex;
	}
	.return-money{
		height: 42rpx;
		padding: 0 20rpx;
		border-radius:16rpx;
		background: rgb(222,75,72);
		display: flex;
		align-items: center;
		color: #FFFFFF;
		font-size: 24rpx;
		margin:15rpx 0 0 12rpx;
	}
	.priceAndShare{
		display: flex;
		margin-top: 40rpx;
		justify-content: space-between;
	}
	.priceAndShareLeft{
		display: flex;
	}
	.normal-price{
		width:694rpx;
		background:#D84C29;
		border-radius: 4rpx;;
		>view:nth-child(1){
			font-size: 20rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #fff;
			margin-top:18rpx;
			margin-left:12rpx;
		}
		>view:nth-child(2){
			display: flex;
			margin-left:12rpx;
			margin-top:5rpx;
			margin-bottom:18rpx;
			// align-items: baseline;
			>text:nth-child(1){
				font-size: 20rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #fff;
				margin-top: 16rpx;
			}
			>text:nth-child(2){
				font-size: 36rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #fff;
				
			}
			
		}
	}
	.price-market-gray{
		display: flex;
		align-items: flex-end;
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #999999;
		margin-left: 15rpx;
		text-decoration: line-through;
		margin-bottom: 10rpx;
		>text{
			margin-left: 15rpx;
		}
	}
	.share-btn{
		display: flex;
		align-items: flex-end;
		margin-right: 20rpx;
		// margin-left: 242rpx;
		>image{
			display: block;
			width:35rpx;
			height: 35rpx;
			margin:0 16rpx 12rpx 0;
		}
		>view{
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FF4924;
			margin-bottom: 10rpx;
		}
	}
	.goods-red-packet{
		display: flex;
		align-items: center;
		margin-top: 16rpx;
		image{
			display: block;
			width: 48rpx;
			height: 48rpx;
		}
		>view:nth-child(2){
			display: flex;
			align-items: center;
			justify-content: center;
			min-width: 228rpx;
			height: 48rpx;
			background: linear-gradient(90deg, #FDE1F3 0%, #FFF5ED 100%);
			border-radius: 8rpx;
			>text:nth-child(1){
				font-size: 24rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #FF4924;
				margin-right: 12rpx;
			}
			>text:nth-child(2){
				font-size: 28rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #FF4924;
			}
		}
	}
	.up-grade-level-tips{
		display: block;
		width: 680rpx;
		height: 68rpx;
		margin: 24rpx auto ;
	}
	.gold-coins{
		width: fit-content;
		height:34rpx;
		background: #FEECDF;
		border-radius: 8rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 10rpx 0 4rpx 14rpx;
	}
	.gold-coins-text-icon{
		display: block;
		height: 30rpx;
	}
	.gold-coins-text{
		width: 54rpx;
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FF4924;
		display: flex;
		align-items: center;
		justify-content: center;
		padding-left: 5rpx;
	}
	.gold-coins-num{
		min-width: 64rpx;
		height: 100%;
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		.redbg{
			display: block;
			width: 100%;
			height:100%;
			position: absolute;
			right: 0;
			top:0;
			z-index: 0;
		}
		.gold-coins-need{
			height: 100%;
			position: relative;
			z-index: 1;
			font-family: PingFangSC-Semibold, PingFang SC;
			font-weight: 600;
			color: #77493B;
			padding: 0 10rpx;
			display: flex;
			align-items: center;
			font-size: 24rpx;
			line-height: 24rpx;
			text{
				font-size: 24rpx;
			}
		}
	}
</style>
